package domin;


import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import util.IdService;

import java.io.Serializable;
import java.security.PublicKey;
import java.sql.Date;
import java.sql.Time;
@ToString
@Setter
@Getter
public class Book implements Comparable<Book>, Serializable {
    private Integer id;
    private String name;
    private  String author;
    private BookCategory bookCategory;
    private Library location;
    private Integer quantitiesInLibrary;
    private Date storageTime;
    private  BookStatus Status;
    {
        this.id = IdService.getId();
    }
    public Book(){

    }

    @Override
    public int compareTo(Book o) {
        // TODO Auto-generated method stub
        return this.id-o.id;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }
}

